NXLogError("Cannot find value for string '%s' in table '%s'.", key, tableName);
tableValue = value ? value : key;
[table insertKey:key value:(void *)value];
}
return tableValue;
}
/* If the application is launched from the Workspace, NXArgv[0] will contain the full pathname of the executable file. If you launch the application from a terminal command line, NXArgv[0] will contain only the filename specified in the command. To get from that file name to the absolute path of its directory, you can use a combination of chdir() and getwd().
*/
void getAppDirectory (char *appDirectory)
{
char *suffix;
strcpy (appDirectory,NXArgv[0]);
if (suffix = rindex(appDirectory,'/'))
*suffix = '\0'; /* remove executable name */
if (appDirectory) chdir(appDirectory);
getwd(appDirectory);
}
/* This method is specific to the AskMe application. It retrieves the proper
* AskMeText folder depending on which language preference has been set
* by the user.
* If the user has not set a language preference,the default language
* "English" will be used.
* Also, getAppDirectory is used to find the full directory path even
* if the user launches the app from the terminal shell.